import {
  getObjectList,
  getObjectLayout,
} from "../services/objectApi";

const initData = {
  objectList: [], // 对象列表
};

export default {
  namespace: "ObjectSource",
  state: {
    ...initData,
  },
  effects: {
    * getObjectList({payload}, {call}) {
      const res = yield call(
        getObjectList,
        payload,
      );
      // yield put({type: "get/objectList", payload: datas || []});
      return res;
    },
    * getObjectLayout({payload}, {call}) {
      const res = yield call(
        getObjectLayout,
        payload,
      );
      // yield put({type: "get/objectList", payload: datas || []});
      return res;
    },


  },
  reducers: {
    // "get/objectList": (state, {payload}) => ({
    //   ...state,
    //   objectList: payload,
    // }),

  },
};
